<?php 
	get_header(); 
?>
						
				<div class="content">
					<div class="header-resultado-de-busca">
						<span class="bread-crumb">
							<?php if(function_exists('bcn_display')) : bcn_display(); endif; ?>
						</span>
						<span class="clear"></span>
						<div class="titulo"><?php post_type_archive_title(); single_term_title(); ?></div>
						<span class="clear"></span>
					</div><!-- /header-resultado-de-busca -->
					<div class="resultado-de-busca">
						<?php if ( have_posts() ) : ?>
						<ul class="lista-resultado-de-busca">				
							<?php while ( have_posts() ) : the_post(); 

								$link = get('informacoes_link_externo');
								$pdf = get('informacoes_arquivo_pdf');
								$target='target="_blank"';

								$class = 'download';
								if ($link == '' && $pdf != '') : 
									$link = $pdf;
									$class = 'download';
								elseif ($link == '' && $pdf == '') : 
									$link = get_permalink(get_the_ID());
									$target = "";
								endif;
							
							if (has_post_thumbnail()) :
						?>
							<li>
								<a class="resultado-de-busca-link" title="<?php the_title(); ?>" href="<?php the_permalink(); ?>">
									<?php the_post_thumbnail('thumbnail', array('title' => get_the_title())); ?>
								</a>
						<?php else : ?>
							<li class="no-image">
						<?php endif; ?>
								<a <?php echo $target; ?> class="resultado-de-busca-link <?php echo $class; ?>" title="<?php the_title(); ?>" href="<?php echo $link; ?>">
									<div class="wrapper-resultado-de-busca">
										<span class="data-resultado-de-busca"><?php the_time('d.m.Y'); ?></span>
										<span class="tit-resultado-de-busca"><?php new_title(58); ?></span>
										<div class="desc-resultado-de-busca">
											<?php new_excerpt(180); ?>
										</div>
									</div>
								</a>
								<span class="clear"></span>
							</li>
							<span class="clear"></span>
							<?php endwhile; ?>
						</ul>
						<?php endif; ?>
						<span class="clear"></span>
						<div class="paginacao">
							<?php wp_pagenavi(); ?>
						</div>
					</div><!-- /resultado-de-busca -->
					<span class="clear"></span>
				</div><!-- /Content -->
				<img class="topo-sidebar" src="<?php bloginfo('template_directory'); ?>/img/topo-sidebar.png" />
				<div class="sidebar sidebar-resultado-de-busca">
					<?php 
						$args_sidebar = array('post_type' => $post_type_actual, 'posts_per_page' => 1);

						if ($taxonomy_actual != false) :
							$args_sidebar['tax_query'] = array(array(
								'taxonomy' => $taxonomy_actual,
								'field' => 'slug',
								'terms' => $taxonomy_slug
							));
						endif;

						$post_sidebar = new WP_Query($args_sidebar);
						$post_sidebar->the_post();
					?>
					<div class="img-sidebar">
						<a title="<?php the_title(); ?>" href="<?php the_permalink(); ?>"><?php the_post_thumbnail('thumbnail-destaque', array('title' => get_the_title())); ?></a>
					</div>
					<div class="noticia-sidebar">
						<a title="<?php the_title(); ?>" href="<?php the_permalink(); ?>">
							<span class="data-noticia-sidebar"><?php the_time('d.m.Y'); ?></span>
							<span class="tit-noticia-sidebar"><?php the_title(); ?></span>
							<div class="desc-noticia-sidebar"><?php the_excerpt(); ?></div>
						</a>
					</div>
					<span class="clear"></span>
					<div class="news news-resultado-de-busca">
						<?php echo do_shortcode('[contact-form-7 id="126" title="Newsletter Sidebar"]'); ?>
					</div><!-- /News -->
				</div><!-- /Sidebar -->

			<?php get_footer(); ?>
